<template>
  <div id="app">
    <el-container>
      <el-header>Maven + Servlet + MyBatis + Vue + ElementUI前后端分离开发</el-header>
      <el-container>
        <el-aside width="170px">
          <el-menu
                  default-active="1"
                  router
                  class="el-menu-vertical-demo"
                  background-color="#545c64"
                  text-color="#fff"
                  active-text-color="#ffd04b">
            <el-submenu :index="m.path"  v-for="m in menus" :key="">
              <template slot="title">
                <i :class="m.icon"></i>
                <span>{{m.title}}</span>
              </template>
              <el-menu-item :index="m.path + child.path" v-for="child in m.children" >
                <i :class="child.icon"></i>
                <span slot="title">{{child.title}}</span>
              </el-menu-item>
            </el-submenu>

          </el-menu>
        </el-aside>
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
    <router-view/>
  </div>
</template>

<style>
  *{
    padding: 0;
    margin: 0;
  }
  .el-header, .el-footer {
    background-color: rgb(84,92,100);
    color: #fff;
    text-align: right;
    line-height: 60px;
  }
  .el-menu{
    border-right: 0px !important;
  }

  .el-aside {
    background-color: rgb(84,92,100);
    color: #333;
    text-align: center;
    line-height: 50px;
    height: 800px;
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 30px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>
<script>
  import menus from "@/api/menu";
  export default {
    name :'App',
    data(){
      return{
        menus
      }
    }
  }
</script>